package file.day9_18.day02;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringAppendDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt",true);
        String line = "，爱在西元前";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);//将字符串类型转换成byte类型存储
        fos.write(data);
        System.out.println("追加内容完成");
        fos.close();
    }

}
